<%@ page language="java" contentType="text/html; charset=UTF-8"
	import="com.zmht.specedu.vo.Teachbook,com.zmht.specedu.vo.Soundstudy,com.zmht.specedu.vo.Teachbook,java.util.*,com.zmht.specedu.frame.model.PageInfoModel"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
	/**
	 * @author 谭湘元
	 * @since 2009/04/23
	 */

 %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb18030" />
<title>聋校备课与语言学习及矫治系统</title>
<fmt:setBundle basename="PathResource" scope="session" />
<link href="<%=request.getContextPath() %>/<fmt:message key='StylePath' />style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/<fmt:message key='jquery' />ajaxHelper.js"></script>
<script type="text/javascript">
	function validateNumber(obj){
		if(obj.value!=""){
			if(isNaN(obj.value)){
				alert("必须是数字！");
				obj.focus();
				obj.select();
			}
		}
	}
</script>
</head>

<body class="bcolor">
<form id="form1" name="form1" method="post" action="teachBook.do?method=queryTeachBooksForView">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#a7c8e6">
    <tr>
      <td><table width="100%" border="0" align="center" cellpadding="3" cellspacing="0" class="fontbot">
          <tr>
            <td width="10%" align="right" valign="middle" bgcolor="#FFFFFF">教材名称：</td>
            <td width="20%" valign="middle" bgcolor="#FFFFFF"><input name="bookName" type="text" class="boxcopy2" value="<c:out value="${param.bookName}"/>" id="textfield10" style="width:140px;" /></td>            
            <td width="10%" align="right" valign="middle" bgcolor="#FFFFFF">教材类别：</td>
            <td width="15%" valign="middle" bgcolor="#FFFFFF"><select name="bookType" class="boxcopy2" id="select" style="width:120px;">
			<option value="">所有</option>
			<c:forEach items="${bookTypes}" var="type">
				<option value="<c:out value="${type.id}" />" <c:if test="${param.bookType==type.id}">selected</c:if>><c:out value="${type.name}" /></option>
			</c:forEach>
            </select></td>
            <td width="10%" align="right" valign="middle" bgcolor="#FFFFFF">使用次数：</td>
            <td width="10%" valign="middle" bgcolor="#FFFFFF"><input name="useTime" type="text" class="boxcopy2" value="<c:out value="${param.useTime }" />" id="textfield" style="width:80px;" onblur="validateNumber(this);" /></td>
            <td align="left" valign="middle" bgcolor="#FFFFFF"><img onclick="document.forms[0].submit();" style="cursor: hand;" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />/gif-03.gif" width="53" height="22" border="0" /></td>
          </tr>
      </table></td>
    </tr>
  </table>
  <table cellspacing="0" cellpadding="0" width="99%" align="center" border="0">
    <tbody>
      <tr>
        <td width="7"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_01.gif" width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_05.gif"><table cellspacing="0" cellpadding="0" width="100%" border="0">
            <tbody>
              <tr>
                <td width="30"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_02.gif" width="30" /></td>
                <td align="left" width="200"  background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_03.gif">&nbsp;<strong>教 材 浏 览</strong></td>
                <td width="59"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_04.gif" width="59" /></td>
                <td>&nbsp;</td>
              </tr>
            </tbody>
        </table></td>
        <td width="8"><img height="38" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_06.gif" width="8" /></td>
      </tr>
      <tr>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_07.gif"><img height="1" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
        <td bgcolor="#f7fbff"><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#a4c9ec" bordercolorlight="#ffffff">
        <tr bgcolor="#CCDDF2">
          <td width="20" valign="middle">&nbsp;</td>
          <td height="20" align="center"><strong>教材名称</strong></td>
          <td align="center"><strong>教材等级</strong></td>
          <td align="center"><strong>时间</strong></td>
          <td align="center"><strong>目标类别</strong></td>
          <td align="center"><strong>教材类别</strong></td>
          <td align="center"><strong>使用次数</strong></td>
          <td align="center"><strong>标准教材</strong></td>
          <td align="center"><strong>浏 览</strong></td>
        </tr>
        
        <%
			PageInfoModel infoModel = (PageInfoModel)request.getAttribute("pagenitionModel");
			if(infoModel!=null){
				List books = (List)infoModel.getResultItems();
			if(books!=null){
				for(int i=0;i<books.size();i++){
					Teachbook book = (Teachbook)books.get(i);
		 %>
        <tr>
          <td height="20" align="center" bgcolor="#FFFFFF"><%=i+1 %>.</td>
          <td height="20" align="center" bgcolor="#FFFFFF"><%=book.getTbookName() %></td>
          <td height="20" align="center" bgcolor="#FFFFFF"><%=book.getTbookClass() %></td>
          <td height="20" align="center" bgcolor="#FFFFFF"><%=book.getTime() %></td>
          <td height="20" align="center" bgcolor="#FFFFFF"><%=book.getFinalType() %></td>
          <td height="20" align="center" bgcolor="#FFFFFF">
          <% 
				List bookTypes = (List)request.getAttribute("bookTypes");
				for(int j=0;j<bookTypes.size();j++){
					Soundstudy type = (Soundstudy) bookTypes.get(j);
					if(book.getTbookType()!=null && book.getTbookType().equals(type.getId())){
						out.print(type.getName());
					}
				}
			%>
				
		  </td>
          <td height="20" align="center" bgcolor="#FFFFFF"><%=book.getUseTimes() %></td>
          <td height="20" align="center" bgcolor="#FFFFFF"><%if(book.getStardTeach()==0){out.print("否");}else{out.print("是");}%></td>
          <td align="center" bgcolor="#FFFFFF"><img style="cursor: pointer;" onclick="openWindow('teachBook.do?method=previewBook&bookId=<%=book.getBookId() %>',600,485,true,'教材浏览');" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />/yulan.gif" width="16" height="16" border="0" /></td>
        </tr>
       <%
				}
			}
		}
		 %>
       
             
       
      </table>
        <jsp:include page="../../common/pagination.jsp"></jsp:include>
      </td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_09.gif"><img height="1" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />spacer.gif" width="1" /></td>
      </tr>
      <tr>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_10.gif" width="7" /></td>
        <td background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_11.gif">&nbsp;</td>
        <td><img height="22" alt="" src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />table_1_12.gif" width="8" /></td>
      </tr>
    </tbody>
  </table>
</form>
</body>
</html>
